package cn.mw.cmdb.enums;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;

public enum OperatorTypeDescEnum {
    add("add", "添加"), update("update", "更新"), remove("remove", "删除"),
    batchAdd("batchAdd", "批量添加"),batchImport("batchImport", "批量导入"),
    batchExport("batchExport", "批量导出"),
    exportTemplate("exportTemplate", "导出模板"),
    batchUpd("batchUpd", "批量更新"),
    batchRemove("batchRemove", "批量删除"),
    scan("scan", "扫描"),
    stopscan("stopscan", "停止扫描")
    ;

    private final String ename;
    private final String cname;

    OperatorTypeDescEnum(String ename, String cname) {
        this.ename = ename;
        this.cname = cname;
    }

    public String getEname() {
        return ename;
    }

    public String getCname() {
        return cname;
    }

    public static JSONArray getOperatorType() {
        JSONArray jsonArray = new JSONArray();
        for (OperatorTypeDescEnum value : OperatorTypeDescEnum.values()) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("ename", value.getEname());
            jsonObject.put("cname", value.getCname());
            jsonArray.add(jsonObject);
        }
        return jsonArray;
    }
}
